package com.gouda.core.dto.coupons;

import com.google.common.collect.Lists;
import lombok.Data;

import java.util.List;

/**
 * Created by 大力 on 2015/12/8.
 */
@Data
public class UserCouponsDto  {
    private long uid;
    private List<CouponsDto> userCoupons;

    public UserCouponsDto() {
        userCoupons = Lists.newArrayList();
    }

    public UserCouponsDto addUserCoupons(final long couponsId, final long userCouponsId,
                                         final long merchantCouponsId, final String couponsName,
                                         final String periodOfValidity) {
        final CouponsDto couponsDto = new CouponsDto(couponsId, userCouponsId, merchantCouponsId,couponsName, periodOfValidity);
        userCoupons.add(couponsDto);
        return this;
    }

    private static class CouponsDto {
        private long couponsId;
        private long userCouponsId;
        private long merchantCouponsId;
        private String couponsName;
        private String periodOfValidity;

        public CouponsDto(final long couponsId, final long userCouponsId,
                          final long merchantCouponsId, final String couponsName,
                          final String periodOfValidity) {
            this.couponsId = couponsId;
            this.userCouponsId = userCouponsId;
            this.merchantCouponsId = merchantCouponsId;
            this.couponsName = couponsName;
            this.periodOfValidity = periodOfValidity;
        }
    }
}
